package com.xjscrm.console.web.chat;

import com.xjscrm.console.chat.enums.ChatMsgType;
import com.xjscrm.console.chat.frame.recv.*;
import com.xjscrm.console.chat.frame.send.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author mingyang.chen create in 2024/3/11 18:37
 */
@RestController
@RequestMapping
public class Apis {

    @ApiOperation(value = "员工上线", notes = "员工上线", response = SResultMsg.class)
    @PostMapping("/online")
    public void online(@RequestBody RStaffMsg onlineFrameMsg) {
    }

    @ApiOperation(value = "员工下线", notes = "员工下线", response = SResultMsg.class)
    @PostMapping("/offline")
    public void offline(@RequestBody RStaffMsg offlineFrameMsg) {
    }

    @ApiOperation(value = "员工暂离", notes = "员工暂离", response = SResultMsg.class)
    @PostMapping("/leave")
    public void leave(@RequestBody RStaffMsg leaveMsg) {
    }

    @ApiOperation(value = "拉取聊天中的设备列表", notes = "拉取聊天中的设备列表", response = SPullDeviceResultMsg.class)
    @PostMapping("/fetchTalkDevice")
    public void fetchDevice(@RequestBody RPullTalkDeviceMsg pullDeviceMsg) {
    }

    @ApiOperation(value = "拉取聊天中的会话列表", notes = "拉取聊天中的会话列表", response = SPullTalkSessionResultMsg.class)
    @PostMapping("/fetchTalkSession")
    public void fetchSession(@RequestBody RPullTalkSessionMsg pullDeviceMsg) {
    }

    @ApiOperation(value = "会话回复消息", notes = "会话回复消息", response = SReplySuccessMsg.class)
    @PostMapping("/sessionReply")
    public void sessionReply(@RequestBody RReplyMsg pullDeviceMsg) {
    }

    @ApiOperation(value = "新会话推送", notes = "新会话推送", response = SNewSessionMsg.class)
    @PostMapping("/newSessionPush")
    public void newSessionPush() {
    }

    @ApiOperation(value = "拉取会话聊天记录", notes = "拉取会话聊天记录", response = SPullRecordResultMsg.class)
    @PostMapping("/pullSessionRecord")
    public void pullSessionRecord(@RequestBody RPullRecordMsg pullSessionRecordMsg) {
    }

    @ApiOperation(value = "发起新群聊会话", notes = "发起新群聊会话", response = SResultMsg.class)
    @PostMapping("/pullNewGroupConversation")
    public void pullNewGroupConversation(@RequestBody RPullNewGroupConversationMsg pullSessionRecordMsg) {
    }

    @ApiOperation(value = "发起私聊会话", notes = "发起私聊会话", response = SResultMsg.class)
    @PostMapping("/pullNewConversation")
    public void pullNewConversation(@RequestBody RPullNewConversationMsg pullSessionRecordMsg) {
    }

    @ApiOperation(value = "清除所有会话", notes = "清除所有会话", response = SResultMsg.class)
    @PostMapping("/cleanAllConversation")
    public void cleanAllConversation(@RequestBody RConversationCleanMsg conversationCleanMsg) {
    }

    @ApiOperation(value = "会话过期", notes = "会话过期", response = SResultMsg.class)
    @PostMapping("/expireConversation")
    public void expireConversation(@RequestBody RConversationExpireMsg conversationExpireMsg) {
    }

    @ApiOperation(value = "会话结束", notes = "会话结束", response = SResultMsg.class)
    @PostMapping("/endConversation")
    public void endConversation(@RequestBody RConversationEndMsg endMsg) {
    }

    @ApiOperation(value = "群聊会话邀请人", notes = "群聊会话邀请人", response = SResultMsg.class)
    @PostMapping("/groupConversationAddMember")
    public void groupConversationAddMember(@RequestBody RConversationAddMemberMsg endMsg) {
    }

    @ApiOperation(value = "群聊会话踢人", notes = "群聊会话踢人", response = SResultMsg.class)
    @PostMapping("/groupConversationKickMember")
    public void groupConversationKickMember(@RequestBody RConversationKickMemberMsg endMsg) {
    }

    @ApiOperation(value = "回话修改备注-私聊修改好用备注, 群聊修改群名称", notes = "回话修改备注-私聊修改好用备注, 群聊修改群名称", response = SResultMsg.class)
    @PostMapping("/conversationSetRemark")
    public void conversationSetRemark(@RequestBody RConversationSetRemarkMsg endMsg) {
    }

    @ApiOperation(value = "会话屏蔽", notes = "会话屏蔽", response = SResultMsg.class)
    @PostMapping("/conversationShield")
    public void conversationShield(@RequestBody RConversationShieldMsg endMsg) {
    }


    @ApiOperation(value = "会话免打扰", notes = "会话免打扰", response = SResultMsg.class)
    @PostMapping("/conversationSilence")
    public void conversationSilence(@RequestBody RConversationSilenceMsg endMsg) {
    }

    @ApiOperation(value = "会话置顶", notes = "会话置顶", response = SResultMsg.class)
    @PostMapping("/conversationPinTop")
    public void conversationPinTop(@RequestBody RConversationTopMsg endMsg) {
    }

    @ApiOperation(value = "获取机器人好友列表", notes = "获取机器人好友列表", response = SPullCustomerResultMsg.class)
    @PostMapping("/pullCustomer")
    public void pullCustomer(@RequestBody RPullCustomerMsg endMsg) {
    }

    @ApiOperation(value = "获取机器人群聊列表", notes = "获取机器人群聊列表", response = SPullGroupResultMsg.class)
    @PostMapping("/pullGroup")
    public void pullGroup(@RequestBody RPullCustomerMsg endMsg) {
    }

    @ApiOperation(value = "获取机器人会话列表", notes = "获取机器人会话列表", response = SPullSessionResultMsg.class)
    @PostMapping("/pullSession")
    public void pullSession(@RequestBody RPullSessionMsg endMsg) {
    }

    @ApiOperation(value = "获取机器人详情", notes = "获取机器人详情", response = SGetDeviceInfoResultMsg.class)
    @PostMapping("/getDeviceInfo")
    public void getDeviceInfo(@RequestBody RGetDeviceInfoMsg endMsg) {
    }

    @ApiOperation(value = "退群", notes = "退群", response = SResultMsg.class)
    @PostMapping("/exitGroup")
    public void exitGroup(@RequestBody RConversationExitMsg endMsg) {
    }

    @ApiOperation(value = "消息已读", notes = "消息已读", response = SResultMsg.class)
    @PostMapping("/read")
    public void read(@RequestBody RReadMsg endMsg) {
    }

    @ApiOperation(value = "消息未读", notes = "消息未读", response = SResultMsg.class)
    @PostMapping("/noRead")
    public void noRead(@RequestBody RNoReadMsg endMsg) {
    }

    @ApiOperation(value = "拉取客户资料", notes = "拉取客户资料", response = SPullConversationResultMsg.class)
    @PostMapping("/pullConversationInfo")
    public void pullConversationInfo(@RequestBody RPullConversationInfoMsg endMsg) {
    }

    @ApiOperation(value = "拉取群资料", notes = "拉取群资料", response = SPullGroupConversationResultMsg.class)
    @PostMapping("/pullGroupConversationInfo")
    public void pullGroupConversationInfo(@RequestBody RPullGroupConversationInfoMsg endMsg) {
    }

    @ApiOperation(value = "转发消息", notes = "转发消息", response = SResultMsg.class)
    @PostMapping("/forwardRecord")
    public void forwardRecord(@RequestBody RForwardRecordMsg endMsg) {
    }

    @ApiOperation(value = "转发多条消息", notes = "转发多条消息", response = SResultMsg.class)
    @PostMapping("/forwardMultiRecord")
    public void forwardMultiRecord(@RequestBody RForwardMultiRecordMsg endMsg) {
    }

    @ApiOperation(value = "心跳", notes = "心跳", response = SHeartBeatResultMsg.class)
    @PostMapping("/heartBeat")
    public void heartBeat(@RequestBody RHeartBeatMsg endMsg) {
    }


    @ApiOperation(value = "消息撤回", notes = "消息撤回", response = SResultMsg.class)
    @PostMapping("/msgRecall")
    public void heartBeat(@RequestBody RRecallMsg endMsg) {
    }

    @ApiOperation(value = "消息类型", notes = "消息类型")
    @PostMapping("/msgType")
    public Object pullSessionRecord() {

        Map<String, Object> result = new HashMap<>();
        for (ChatMsgType value : ChatMsgType.values()) {
            result.put(String.valueOf(value.getCode()), value.getDesc());
        }
        return result;
    }
}
